<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:include="common/template :: res(title='项目登记')">
	
</head>
<body style="padding-left:5px;">
<script type="text/javascript">
		$(function(){
			
			$('input:radio[name="userType"]').change(function() {
				userTypeAction();
			});
			$('#formSubimt').click(function(){
				var userType = $('input:radio[name="userType"]:checked').val();
				
				doRequest({
					type:'POST',
					url:'regProject',
					data:{
						finaAccType:userType,
						projectName:$('#projectName').val(),
						projectAmt:$('#projectAmt').val(),
						rateVal:$('#rateVal').val(),
						cycVal:$('#cycVal').val(),
						projectUse:$('#projectUse').val(),
						orgCode:$('#orgCode').val(),
						finaIpsAcctNo:$('#ipsAcctNo').val()
					}
				},function(data){
					console.log(data);
					print('项目登记成功');
					location.href="redirect?redirect=list/project";
				});
			});
			userTypeAction();
		});
		
		function userTypeAction(){
			var $selectedvalue = $("input[name='userType']:checked").val();

			doRequest({
				url:'users',
				data:{
					type:$selectedvalue
				}
			},function(data){
				console.log(data);
				var html ='';
				
				$(data).each(function(index,d){
					var showInfo=$selectedvalue==1?d.realName:d.enterName;
					html +=('<option value="'+d.ipsAcctNo+'">'+showInfo+'</option>');
				});
				$('#ipsAcctNo').html(html);
			});
		}
	</script>
	<div class="alert alert-success toptips" role="alert" id="js_tooltips"  style="display:none;z-index:100;">信息展示窗口</div>
	
	<div class="page-header">
	<h2>江苏亦融在线  <small>支付调试</small></h2>

	</div>
<ol class="breadcrumb">
  <li ><a href="index">首页</a> </li>
  <li class="active">项目登记</li>
</ol>

	

	<div class="form-horizontal" style="padding-left:20px;" >
		<div class="form-group">
			<label >融资方账户类型(测试方便只支持企业)</label>
			<div>
				<label class="checkbox-inline"> <input type="radio" name="userType"
					 value="1" />个人
				</label> <label class="checkbox-inline"> <input type="radio" name="userType"
					 value="2" checked="checked"/>企业
				</label>
			</div>
		</div>
		<div class="form-group">
			<label >融资方用户</label> 
			<select class="combobox" id="ipsAcctNo"  style="width:150px;"> </select>
		</div>
		<div class="form-group">
			<label >项目名称</label> <input type="text" class="form-control"
				id="projectName" value="企业周转资金" />
		</div>
		<div class="form-group">
			<label >项目金额</label> <input type="text" class="form-control"
				id="projectAmt" value="1000000"/>
		</div>
		<div class="form-group">
			<label >项目利率(%)</label> <input type="text"
				class="form-control" id="rateVal" value="12"/>
		</div>
		<div class="form-group">
			<label >项目天数(天)</label> <input type="text"
				class="form-control" id="cycVal" value="180"/>
		</div>
		<div class="form-group">
			<label >项目用途</label> <input type="text"
				class="form-control" id="projectUse" value="企业融资" />
		</div>
		
		<div class="form-group">
			
				<button  class="btn btn-default" id="formSubimt">提交</button>
			
		</div>
	</div>

	
</body>
</html>